using UnityEngine;
using System.Collections;

public class Final : MonoBehaviour {

	public TextMesh metters;
	public RankingSet rank;
	string name = "";
	
	// Update is called once per frame
	void Start () 
	{
		metters.text = "Your Run "+PlayerPrefs.GetInt("Mts")+" Metters!";
	}
	
	void OnGUI()
	{
		name = GUI.TextField(new Rect(400,230,200,20),name,15);
		
		if(GUI.Button(new Rect(450,260,100,30),"Save Score"))
		{
			rank.SaveRanking(PlayerPrefs.GetInt("Mts"),name);
			Application.LoadLevel("Menu");
		}
	}
}

